﻿@inject IStringLocalizer<EyeDroppers> Localizer

<Button Text="@Localizer["EyeDropperNormalButtonText"]" OnClick="OnOpen"></Button>

<div class="mt-3 d-flex">
    <div style="width: 35px; height: 35px; border: 1px solid var(--bs-border-color); border-radius: var(--bs-border-radius); margin-right: .5rem; background-color: @ValueString"></div><Display Value="@Value"></Display>
</div>

@code {
    [Inject]
    [NotNull]
    private EyeDropperService? EyeDropperService { get; set; }

    private string? Value { get; set; }

    private string ValueString => Value ?? "#fff";

    private async Task OnOpen()
    {
        Value = await EyeDropperService.PickAsync();
    }
}
